package com.cnap.model.application;

import com.cnap.model.validator.EnumCheck;
import com.cnap.utils.JsonUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 更新应用模型
 *
 * @author xc
 **/
@ApiModel
public class UpdateApplicationParam {
    /**
     * id
     */
    @ApiModelProperty(value = "id")
    @NotBlank(message = "id不能为空")
    private String id;
    /**
     * 分类
     */
    @ApiModelProperty(value = "分类名称")
    @NotNull(message = "分类名称不能为null")
    @EnumCheck(enumClass = CategoryEnum.class, message = "分类类型校验错误")
    private String category;
    /**
     * 二级分类
     */
    @ApiModelProperty(value = "二级分类")
    @EnumCheck(enumClass = CategoryTypeEnum.class, message = "二级分类类型校验错误")
    private String type;
    @NotBlank
    @ApiModelProperty(value = "版本")
    private String version;
    @Length(min = 0, max = 100)
    @ApiModelProperty(value = "描述")
    private String description;
    @ApiModelProperty(value = "标签")
    private ApplicationLabel label;
    @ApiModelProperty(value = "部署资源池信息")
    private DeployResourceInfo deployResourceInfo;

    /**
     * get
     *
     * @return DeployResourceInfo
     */
    public DeployResourceInfo getDeployResourceInfo() {
        return deployResourceInfo;
    }

    /**
     * set
     *
     * @param deployResourceInfo deployResourceInfo
     */
    public void setDeployResourceInfo(DeployResourceInfo deployResourceInfo) {
        this.deployResourceInfo = deployResourceInfo;
    }

    /**
     * 获取标签
     *
     * @return 标签
     */
    public ApplicationLabel getLabel() {
        return label;
    }

    /**
     * 设置标签
     *
     * @param label 标签
     */
    public void setLabel(ApplicationLabel label) {
        this.label = label;
    }

    /**
     * 获取id
     *
     * @return id
     */
    public String getId() {
        return id;
    }

    /**
     * 设置id
     *
     * @param id id
     */
    public void setId(String id) {
        this.id = id;
    }

    /**
     * 分类
     *
     * @return 分类
     */
    public String getCategory() {
        return category;
    }

    /**
     * 设置分类
     *
     * @param category 分类
     */
    public void setCategory(String category) {
        this.category = category;
    }

    /**
     * 获取类型
     *
     * @return 类型
     */
    public String getType() {
        return type;
    }

    /**
     * 设置类型
     *
     * @param type 类型
     */
    public void setType(String type) {
        this.type = type;
    }

    /**
     * 获取版本
     *
     * @return 版本
     */
    public String getVersion() {
        return version;
    }

    /**
     * 设置版本
     *
     * @param version 版本
     */
    public void setVersion(String version) {
        this.version = version;
    }

    /**
     * 获取描述
     *
     * @return 描述
     */
    public String getDescription() {
        return description;
    }

    /**
     * 设置描述
     *
     * @param description 描述
     */
    public void setDescription(String description) {
        this.description = description;
    }

    @Override
    public String toString() {
        return JsonUtil.objectToJsonStr(this);
    }
}
